Add message-driven RestartExecutions to FlowsManager#179
Merged
Conversation
Move RestartExecutions into the per-type FlowsManager so it can claim and resume flows targeted by fetched messages: - Restart unowned flows via RestartExecutionsWithoutMessages and resume each through an IFlowRestarter (implemented by Invoker) using the in-hand messages - no re-claim or extra store round-trip. - Reopen the message-clearer positions of flows that could not be claimed (dropped from the ignore-set without deleting them from the store). - Add ReopenPositions to IMessageClearer; inject MessageClearer and ClusterInfo (non-nullable) into FlowsManager; wire the restarter in FunctionsRegistry after each Invoker is built.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves
RestartExecutionsinto the per-typeFlowsManagerso it can claim and resume flows targeted by fetched messages, rather than only delivering to already-live flows.RestartExecutionsWithoutMessages, then each is resumed through a new non-genericIFlowRestarter(implemented explicitly byInvoker<TParam,TReturn>) using the in-hand messages — no re-claim or extra store round-trip, since the store's return value carries the flow snapshot the restarter needs.ReopenPositionsis added toIMessageClearer.FlowsManagernow receives non-nullableMessageClearerandClusterInfo;FunctionsRegistrysets the restarter on each per-type manager right after theInvokeris constructed (late-bound, since the invoker doesn't exist whenGetOrCreateruns).Notes / follow-ups
IFlowRestarterlives on theInvoker(notInvocationHelper) because the restart drives the user-function execution loop (_inner).ScheduleRestartFromWatchdogdelegate is unchanged and still used by thePostponedWatchdogpath; it has the same signature asIFlowRestarterand could be converged later.Invoker.PrepareForReInvocationdoes not yet pushRestartedFunction.StoredMessagesinto theQueueManager, so a restarted flow currently re-fetches its messages from the store rather than consuming the in-hand copies.🤖 Generated with Claude Code